3.3.17 \(\int \frac {(c+d x^2)^2}{x^4 (a+b x^2)} \, dx\) [217]

Optimal. Leaf size=64 \[ -\frac {c^2}{3 a x^3}+\frac {c (b c-2 a d)}{a^2 x}+\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{5/2} \sqrt {b}} \]

[Out]

-1/3*c^2/a/x^3+c*(-2*a*d+b*c)/a^2/x+(-a*d+b*c)^2*arctan(x*b^(1/2)/a^(1/2))/a^(5/2)/b^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {472, 211} \begin {gather*} \frac {\text {ArcTan}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right ) (b c-a d)^2}{a^{5/2} \sqrt {b}}+\frac {c (b c-2 a d)}{a^2 x}-\frac {c^2}{3 a x^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x^2)^2/(x^4*(a + b*x^2)),x]

[Out]

-1/3*c^2/(a*x^3) + (c*(b*c - 2*a*d))/(a^2*x) + ((b*c - a*d)^2*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(a^(5/2)*Sqrt[b])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 472

Int[(((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_))/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Int[ExpandIntegr
and[(e*x)^m*((a + b*x^n)^p/(c + d*x^n)), x], x] /; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n
, 0] && IGtQ[p, 0] && (IntegerQ[m] || IGtQ[2*(m + 1), 0] ||  !RationalQ[m])

Rubi steps

\begin {align*} \int \frac {\left (c+d x^2\right )^2}{x^4 \left (a+b x^2\right )} \, dx &=\int \left (\frac {c^2}{a x^4}+\frac {c (-b c+2 a d)}{a^2 x^2}+\frac {(-b c+a d)^2}{a^2 \left (a+b x^2\right )}\right ) \, dx\\ &=-\frac {c^2}{3 a x^3}+\frac {c (b c-2 a d)}{a^2 x}+\frac {(b c-a d)^2 \int \frac {1}{a+b x^2} \, dx}{a^2}\\ &=-\frac {c^2}{3 a x^3}+\frac {c (b c-2 a d)}{a^2 x}+\frac {(b c-a d)^2 \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{5/2} \sqrt {b}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 66, normalized size = 1.03 \begin {gather*} -\frac {c^2}{3 a x^3}-\frac {c (-b c+2 a d)}{a^2 x}+\frac {(-b c+a d)^2 \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{a^{5/2} \sqrt {b}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x^2)^2/(x^4*(a + b*x^2)),x]

[Out]

-1/3*c^2/(a*x^3) - (c*(-(b*c) + 2*a*d))/(a^2*x) + ((-(b*c) + a*d)^2*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/(a^(5/2)*Sqrt
[b])

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 70, normalized size = 1.09

method result size
default \(\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{a^{2} \sqrt {a b}}-\frac {c^{2}}{3 a \,x^{3}}-\frac {c \left (2 a d -b c \right )}{a^{2} x}\) \(70\)
risch \(\frac {-\frac {c \left (2 a d -b c \right ) x^{2}}{a^{2}}-\frac {c^{2}}{3 a}}{x^{3}}+\frac {\left (\munderset {\textit {\_R} =\RootOf \left (a^{5} \textit {\_Z}^{2} b +a^{4} d^{4}-4 a^{3} b c \,d^{3}+6 a^{2} b^{2} c^{2} d^{2}-4 a \,b^{3} c^{3} d +b^{4} c^{4}\right )}{\sum }\textit {\_R} \ln \left (\left (3 \textit {\_R}^{2} a^{5} b +2 a^{4} d^{4}-8 a^{3} b c \,d^{3}+12 a^{2} b^{2} c^{2} d^{2}-8 a \,b^{3} c^{3} d +2 b^{4} c^{4}\right ) x +\left (-d^{2} a^{5}+2 b c d \,a^{4}-b^{2} c^{2} a^{3}\right ) \textit {\_R} \right )\right )}{2}\) \(192\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x^2+c)^2/x^4/(b*x^2+a),x,method=_RETURNVERBOSE)

[Out]

(a^2*d^2-2*a*b*c*d+b^2*c^2)/a^2/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))-1/3*c^2/a/x^3-c*(2*a*d-b*c)/a^2/x

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 70, normalized size = 1.09 \begin {gather*} \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} a^{2}} - \frac {a c^{2} - 3 \, {\left (b c^{2} - 2 \, a c d\right )} x^{2}}{3 \, a^{2} x^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)^2/x^4/(b*x^2+a),x, algorithm="maxima")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a^2) - 1/3*(a*c^2 - 3*(b*c^2 - 2*a*c*d)*x^2)/
(a^2*x^3)

________________________________________________________________________________________

Fricas [A]
time = 1.45, size = 190, normalized size = 2.97 \begin {gather*} \left [-\frac {3 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {-a b} x^{3} \log \left (\frac {b x^{2} - 2 \, \sqrt {-a b} x - a}{b x^{2} + a}\right ) + 2 \, a^{2} b c^{2} - 6 \, {\left (a b^{2} c^{2} - 2 \, a^{2} b c d\right )} x^{2}}{6 \, a^{3} b x^{3}}, \frac {3 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {a b} x^{3} \arctan \left (\frac {\sqrt {a b} x}{a}\right ) - a^{2} b c^{2} + 3 \, {\left (a b^{2} c^{2} - 2 \, a^{2} b c d\right )} x^{2}}{3 \, a^{3} b x^{3}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)^2/x^4/(b*x^2+a),x, algorithm="fricas")

[Out]

[-1/6*(3*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(-a*b)*x^3*log((b*x^2 - 2*sqrt(-a*b)*x - a)/(b*x^2 + a)) + 2*a^2*
b*c^2 - 6*(a*b^2*c^2 - 2*a^2*b*c*d)*x^2)/(a^3*b*x^3), 1/3*(3*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(a*b)*x^3*arc
tan(sqrt(a*b)*x/a) - a^2*b*c^2 + 3*(a*b^2*c^2 - 2*a^2*b*c*d)*x^2)/(a^3*b*x^3)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (56) = 112\).
time = 0.42, size = 172, normalized size = 2.69 \begin {gather*} - \frac {\sqrt {- \frac {1}{a^{5} b}} \left (a d - b c\right )^{2} \log {\left (- \frac {a^{3} \sqrt {- \frac {1}{a^{5} b}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} + \frac {\sqrt {- \frac {1}{a^{5} b}} \left (a d - b c\right )^{2} \log {\left (\frac {a^{3} \sqrt {- \frac {1}{a^{5} b}} \left (a d - b c\right )^{2}}{a^{2} d^{2} - 2 a b c d + b^{2} c^{2}} + x \right )}}{2} + \frac {- a c^{2} + x^{2} \left (- 6 a c d + 3 b c^{2}\right )}{3 a^{2} x^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x**2+c)**2/x**4/(b*x**2+a),x)

[Out]

-sqrt(-1/(a**5*b))*(a*d - b*c)**2*log(-a**3*sqrt(-1/(a**5*b))*(a*d - b*c)**2/(a**2*d**2 - 2*a*b*c*d + b**2*c**
2) + x)/2 + sqrt(-1/(a**5*b))*(a*d - b*c)**2*log(a**3*sqrt(-1/(a**5*b))*(a*d - b*c)**2/(a**2*d**2 - 2*a*b*c*d
+ b**2*c**2) + x)/2 + (-a*c**2 + x**2*(-6*a*c*d + 3*b*c**2))/(3*a**2*x**3)

________________________________________________________________________________________

Giac [A]
time = 0.53, size = 72, normalized size = 1.12 \begin {gather*} \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {a b} a^{2}} + \frac {3 \, b c^{2} x^{2} - 6 \, a c d x^{2} - a c^{2}}{3 \, a^{2} x^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x^2+c)^2/x^4/(b*x^2+a),x, algorithm="giac")

[Out]

(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*a^2) + 1/3*(3*b*c^2*x^2 - 6*a*c*d*x^2 - a*c^2
)/(a^2*x^3)

________________________________________________________________________________________

Mupad [B]
time = 0.08, size = 90, normalized size = 1.41 \begin {gather*} \frac {b\,c^2}{a^2\,x}-\frac {c^2}{3\,a\,x^3}+\frac {b^{3/2}\,c^2\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{a^{5/2}}+\frac {d^2\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{\sqrt {a}\,\sqrt {b}}-\frac {2\,c\,d}{a\,x}-\frac {2\,\sqrt {b}\,c\,d\,\mathrm {atan}\left (\frac {\sqrt {b}\,x}{\sqrt {a}}\right )}{a^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x^2)^2/(x^4*(a + b*x^2)),x)

[Out]

(b*c^2)/(a^2*x) - c^2/(3*a*x^3) + (b^(3/2)*c^2*atan((b^(1/2)*x)/a^(1/2)))/a^(5/2) + (d^2*atan((b^(1/2)*x)/a^(1
/2)))/(a^(1/2)*b^(1/2)) - (2*c*d)/(a*x) - (2*b^(1/2)*c*d*atan((b^(1/2)*x)/a^(1/2)))/a^(3/2)

________________________________________________________________________________________